﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Gerenciador/Gerenciador.Master" AutoEventWireup="true" CodeBehind="FormEnquete.aspx.cs" Inherits="CasaisEmEdificacao.Gerenciador.enquete.FormEnquete" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="titulo" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="script" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="modulo" runat="server">
    Modulo Enquete
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="pagina" runat="server">
    Lista de Enquetes
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="acoesModulo" runat="server">
    <h1>
        <asp:LinkButton runat="server" ID="linkNovaEnquete" 
            onclick="linkNovaEnquete_Click">Nova Enquete</asp:LinkButton>    
    </h1>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="conteudo" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:HiddenField ID="hidCodEnquete" runat="server" />
            <asp:Label ID="lblMensagem" runat="server"></asp:Label>
            <table width="780px" border="0" cellpadding="0" cellspacing="0">
            <asp:ListView ID="listPergunta" runat="server" 
                    onitemdatabound="listPergunta_ItemDataBound" 
                    onitemcommand="listPergunta_ItemCommand">
                <ItemTemplate>
                    <asp:HiddenField ID="codPergunta" runat="server" Value='<%#Eval("CO_ENQUETE")%>' />
                    <tr style="background-color:#d5dfe0;">
                        <td width="540px">
                            <%#Eval("DS_ENQUETE") %>
                        </td>
                        <td width="80px">
                            <asp:LinkButton runat="server" ID="linkEditarEnquete" CommandArgument='<%#Eval("CO_ENQUETE") %>' CommandName="Editar">Editar</asp:LinkButton>
                        </td>
                        <td width="80px">
                            <asp:LinkButton runat="server" ID="LinkNovaPergunta" CommandArgument='<%#Eval("CO_ENQUETE") %>' CommandName="Pergunta">Pergunta</asp:LinkButton>
                        </td>
                        <td width="80px">
                            <asp:LinkButton runat="server" ID="linkEnquete" CommandArgument='<%#Eval("CO_ENQUETE") %>' CommandName="Excluir">Excluir</asp:LinkButton>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:ListView ID="listResposta" runat="server" onitemcommand="listResposta_ItemCommand">
                                <ItemTemplate>
                                    <table width="780px" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td width="620px">
                                               <%#Eval("DS_RESPOSTA") %>  
                                            </td>
                                            <td  width="80px">
                                                <%#Eval("NR_HITS") %>  
                                            </td>
                                            <td  width="80px">
                                                <asp:LinkButton runat="server" ID="linkResposta" CommandArgument='<%#Eval("CO_RESPOSTA_ENQUETE") %>' CommandName="Excluir">Excluir</asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:ListView>
                        </td>
                    </tr>                    
                </ItemTemplate>
                
            </asp:ListView>
            </table>
        
        <div style="display:none;">
            <asp:HyperLink ID="linkEnquete" runat="server">HyperLink</asp:HyperLink>
        </div>



        <asp:ModalPopupExtender ID="ModalEnquete" runat="server"
            TargetControlID="linkEnquete"
            PopupControlID="Panel2" 
            BackgroundCssClass="modalBackground" 
            CancelControlID="btnCancelarExclusao"
            DropShadow="true"/>

        <asp:Panel ID="Panel2" runat="server" Style="display:none" Width="350px" CssClass="modalPopup">
            <asp:Panel ID="Panel4" runat="server" Style="border-bottom:solid 1px Gray;height:25px;">
                <div>
                    <h1 style="line-height:25px;text-align:center;margin:0px 0px 0px 0px;vertical-align:bottom;padding:0px 0px 0px 0px;font-size:14px;font-family:Verdana;">
                        Formulário
                    </h1>
                </div>                
            </asp:Panel>
                                           
            <div>
                <br />

                <table>
                    <tr>
                        <td>
                            Pergunta
                        </td>
                        <td>
                            <asp:TextBox ID="txtPergunta" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                </table>
                
                <br />
                
                <table width="100%">
                    <tr>
                        <td>
                            <asp:Button ID="btnCancelarExclusao" runat="server" Text="Cancelar" />
                        </td>
                        <td align="right">
                            <asp:Button ID="btnIncluirEnquete" runat="server" Text="Salvar" 
                                onclick="btnIncluirEnquete_Click" />
                            <asp:Button ID="btnAlterarEnquete" runat="server" Text="Alterar" 
                                onclick="btnAlterarEnquete_Click" />
                        </td>
                    </tr>
                </table>                
            </div>
        </asp:Panel>

        <!--    -->

        <div style="display:none;">
            <asp:HyperLink ID="linkPergunta" runat="server">HyperLink</asp:HyperLink>
        </div>



        <asp:ModalPopupExtender ID="ModalPergunta" runat="server"
            TargetControlID="linkPergunta"
            PopupControlID="Panel1" 
            BackgroundCssClass="modalBackground" 
            CancelControlID="btnCancelar"
            DropShadow="true"/>

        <asp:Panel ID="Panel1" runat="server" Style="display:none" Width="350px" CssClass="modalPopup">
            <asp:Panel ID="Panel3" runat="server" Style="border-bottom:solid 1px Gray;height:25px;">
                <div>
                    <h1 style="line-height:25px;text-align:center;margin:0px 0px 0px 0px;vertical-align:bottom;padding:0px 0px 0px 0px;font-size:14px;font-family:Verdana;">
                        Formulário
                    </h1>
                </div>                
            </asp:Panel>
                                           
            <div>
                <br />

                <table>
                    <tr>
                        <td>
                            Resposta
                        </td>
                        <td>
                            <asp:TextBox ID="txtResposta" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                </table>
                
                <br />
                
                <table width="100%">
                    <tr>
                        <td>
                            <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" />
                        </td>
                        <td align="right">
                            <asp:Button ID="btnIncluirResposta" runat="server" Text="Salvar" 
                                onclick="btnIncluirResposta_Click" />
                            
                        </td>
                    </tr>
                </table>                
            </div>
        </asp:Panel>

        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>